package org.niugang.dubbo.consumer;

import org.niugang.dubbo.provider.GreetingService;

import com.alibaba.dubbo.config.ApplicationConfig;
import com.alibaba.dubbo.config.ReferenceConfig;
import com.alibaba.dubbo.config.RegistryConfig;
/**
 * 
 * @ClassName:  Consumer   
 * @Description:服务消费者  
 * @author: niugang
 * @date:   2018年8月17日 上午11:03:27   
 * @Copyright: 863263957@qq.com. All rights reserved. 
 *
 */
public class Consumer {

	public static void main(String[] args) {
		ReferenceConfig<GreetingService> referenceConfig = new ReferenceConfig<GreetingService>();
		referenceConfig.setApplication(new ApplicationConfig("first-dubbo-consumer"));
		referenceConfig.setRegistry(new RegistryConfig("redis://localhost:6379"));
		referenceConfig.setInterface(GreetingService.class);
		GreetingService greetingService = referenceConfig.get();
		System.out.println(greetingService.sayHello("world"));
	}

}
